package com.net.oil.message.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.message.bean.MessageBean;
import com.net.oil.message.contract.MessageContract;
import com.net.oil.message.model.MessageModel;

/**
 * 作者：lch
 * 时间：2018/4/13 0013:下午 15:57
 * 邮箱：245850413@qq.com
 * 说明：
 */

public class MessagePresenter extends BasePresenter<MessageContract.View> implements MessageContract.Presenter {

    private MessageContract.Model model;
    private MessageContract.View view;

    public MessagePresenter(MessageContract.View view) {
        this.view = view;
        model = new MessageModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void getMessageList(int page, int pageSize) {
        model.getMessageList(page, pageSize);
    }

    @Override
    public void getMessageListSuccess(MessageBean messageBean) {
        view.getMessageListSuccess(messageBean);
    }

    @Override
    public void getMessageListFailed() {
        view.getMessageListFailed();
    }

    @Override
    public void deleteMessage(int id) {
        model.deleteMessage(id);
    }

    @Override
    public void deleteMessageSuccess() {
        view.deleteMessageSuccess();
    }

    @Override
    public void deleteMessageFailed() {
        view.deleteMessageFailed();
    }
}
